<div class="bglist">
	<div class="bglistq">
		
		<table>
		<tr>
		<td>
			<a class="button" href="<?php echo $this->baseUrl() ?>/cpsetings/header">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/left_16.png);" class="inb">Wróć do listy</div>
			</a>
		</td>
		<td>
			<a class="button" href="javascript:void(null)" onclick="$('#formitem').submit()">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/save_16.png);" class="inb">Zapisz</div>
			</a>
		</td>
		</tr>
		</table>
			
			<form id="formitem" action="<?php echo $this->baseUrl() ?>/cpsetings/edit/id/<?php echo $this->header?>/opper/1" method="post">
			<?php
				for($k = 1, $i=1;$i<=4;$i++)
				{
				?>
				<table cellspacing="1" cellpadding="6" class="tlist"><br /><b>Sekcja: <?php echo $i;?></b> <?php 
				
				for($j=1;$j<=3;$j++)
				{
				?>
				<tr>
				<td class="lb">Plik nr: <?php echo $j;?></td>
				<td class="inpy">
			<?php  
				$this->fileTypes = '"*.jpg"';
				$this->fileTypesDescription = 'Tylko zdjęcia';
				$this->uploadSuccess = 'uploadSuccessImg2';
				$this->placeholder = 'spanButtonPlaceholder_'.$k;
				$this->progres = 'fsUploadProgress'.$k;
				$this->cancel = 'btnCancel'.$k; 
				echo $this->render('global/uploader.phtml');
			?>
			<div id="imgcont<?php echo $k;?>">
	
	
			<?php 
			$K = 0;
			//echo $this->item2[$k-1];
			if(($this->item2[$k-1]) != 0){
			
				$K = 1;
				
				//if( $this->item[$k-1]['number'] == $k){
				?>
			
				<div id="btnbtn<?php echo $k;?>" class="img" style="width:170px;padding:0px;">
					<a onclick="if( confirmDelete() ){ $( '#imgcont<?php echo $k;?>' ).empty();  $( '#imgDEL<?php echo $k?>' ).attr({ value : 'del' }); $( '#img<?php echo $k?>' ).attr({ value : '' })  }" style="opacity:0;margin:0px;text-align:center;background:red;width: 170px;" class="delete" href="javascript:void(null)">Usuń</a>
					<img src="<?php echo $this->File( $this->item[$this->item2[$k-1]-1]['img'], 170 ) ?>" />
				</div>
			
			
			<?php 
			
				echo $this->inlineScript()->setScript('
					$( "#btnbtn'.$k.'" ).hover(function(){
						$(this).find( "a" ).css({ opacity: 0, display : "block", cursor : "pointer" }).animate({
							opacity : 0.9
						});
					}, function(){
						$(this).find( "a" ).animate({
							opacity : 0
						});
					});
				');
			
			}?>
			</div>
			<input id="img<?php echo $k;?>" type="hidden" name="img<?php echo $k;?>" value="" />
			
			<input id="imgID<?php echo $k;?>" type="hidden" name="imgID<?php echo $k;?>" value="<?php if($K == 1){ echo $this->item[$this->item2[$k-1]-1]['h_id']; $K = 0;} else echo ""; ?>" />
			<input id="imgDEL<?php echo $k;?>" type="hidden" name="imgDEL<?php echo $k;?>" value="" />
			<div>
				<div class="fieldset flash" id="fsUploadProgress<?php echo $k?>">
					<span class="legend"></span>
				</div>
				<div style="padding-left: 5px;">
					<span id="spanButtonPlaceholder_<?php echo $k?>"></span>
					<input id="btnCancel<?php echo $k?>" type="button" value="Anuluj" onclick="cancelQueue(upload1);" disabled="disabled" style="margin-left: 2px; height: 22px; font-size: 8pt;width:120px;" />
					<br />
				</div>
			</div>
		
		</td>
				</tr>
				
				<?php 
				$k++;
				}
				?></table><?php 
			} 
			?>

		</table></form>
		
		<table>
		<tr>
		<td>
			<a class="button" href="<?php echo $this->baseUrl() ?>/cpsetings/header">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/left_16.png);" class="inb">Wróć do listy</div>
			</a>
		</td>
		<td>
			<a class="button" href="javascript:void(null)" onclick="$('#formitem').submit()">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/save_16.png);" class="inb">Zapisz</div>
			</a>
		</td>
		</tr>
		</table>
	</div>
</div>